package com.gydx.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.gydx.pojo.Person;
import com.gydx.service.PersonService;

@Controller
public class PersonController {
	@Autowired
	PersonService personService;
	
	@RequestMapping("/findPerLikeName")
	public String findPerLikeName(@RequestParam(defaultValue="") String name,Model model) {
		
		List<Person> list = personService.findPerLikeName(name);
		
		model.addAttribute("list",list);
		
		return "personList";
	}
}
